package testCases;

import javax.swing.JFrame;

import Code.DisplayPanel;
import Code.Grid;
import Code.Point;
import Code.Tank;
import Code.Team;

public class TestDisplay {


	public static void main(String[] args) 
	{
		int worldDimension = 400;
		int occDimension = 100;
		final JFrame jFrame = new JFrame();
		jFrame.setBounds(100, 100, worldDimension/2, worldDimension/2);
		jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		Grid grid = new Grid(worldDimension, worldDimension, occDimension);
		final DisplayPanel panel = new DisplayPanel(grid);
		jFrame.add(panel);
		
		jFrame.setVisible(true);
		
		String[] attributes = {"0", "1","1", "1", "1", Double.toString(1d), Team.BLUE.toString(), 
				Double.toString(0d), Double.toString(-180d), Double.toString(Math.PI),
				"1", "1", "1"}; 
		Tank tank = new Tank(attributes);
		
		for (int x = 0; x < 100; x++)
		{
			for (int y = 0; y < 100; y++)
				grid.updateValue(new Point(x, y), 0.95);
		}
		
		for (int x = 150; x < 250; x++)
		{
			for (int y = 0; y < 100; y++)
				grid.updateValue(new Point(x, y), 0.9);
		}
		
		for (int x = 300; x < 400; x++)
		{
			for (int y = 0; y < 100; y++)
				grid.updateValue(new Point(x, y), 0.8);
		}
		
		for (int x = 0; x < 100; x++)
		{
			for (int y = 150; y < 250; y++)
				grid.updateValue(new Point(x, y), 0.7);
		}
		
		for (int x = 150; x < 250; x++)
		{
			for (int y = 150; y < 250; y++)
				grid.updateValue(new Point(x, y), 0.6);
		}
		
		for (int x = 300; x < 400; x++)
		{
			for (int y = 150; y < 250; y++)
				grid.updateValue(new Point(x, y), 0.5);
		}
		
		for (int x = 0; x < 100; x++)
		{
			for (int y = 300; y < 400; y++)
				grid.updateValue(new Point(x, y), 0.4);
		}
		
		for (int x = 150; x < 250; x++)
		{
			for (int y = 300; y < 400; y++)
				grid.updateValue(new Point(x, y), 0.3);
		}
		
		for (int x = 300; x < 400; x++)
		{
			for (int y = 300; y < 400; y++)
				grid.updateValue(new Point(x, y), 0.2);
		}
		grid.update(tank, new Point (100, 100));
	}
}
